<?php
class admin_controller_admin_operate extends AdminController {
	private  $obj;
	/*private static function init(){
		if(!$this->obj)
			$this->obj = Model::factory('admin_model_operate');
	}*/
	
	
	public function list_detail_action(){
		$this->obj = Model::factory('admin_model_operate');
		$para['uid']		= 	_('uid','');
		$para['res_type']	= 	_('rtype','');
		$para['operater'] 	= 	_('opr','');
		$para['starttime'] 	=	_('start','');
		$para['res_id']		=	_('res_id','');
		$para['endtime']	=	_('end','');
		$page 				=	_('page',1);
		$ret = $this->obj->getOperateLogList($para,$page,20);
		$pages = $this->genPages($ret['INFO'],array('uid'=>_('uid',''),'rtype'=>_('rtype',''),'opr'=>_('opr',''),'start'=>_('start',''),'end'=>_('end','')),true);
		$this->ret = self::success(array('ret'=>$ret, 'pages'=>$pages));
		$this->view = 'list_detail';
	}
	
	public function list_action(){
		$this->obj = Model::factory('admin_model_operate');
		$para['uid']		= 	_('uid','');
		$para['res_type']	= 	_('rtype','');
		$para['operater'] 	= 	_('opr','');
		$para['starttime'] 	=	_('start','');
		$para['min']		=	_('min',0);
		$para['max']		=	_('max','');
		$para['endtime']	=	_('end','');
		$page 				=	_('page',1);
		$total = '';
		$ret = $this->obj->getOperateLogStat($para,$page,20,$total);
		$pages = $this->genPages($ret['INFO'],array('uid'=>_('uid',''),'rtype'=>_('rtype',''),'opr'=>_('opr',''),'start'=>_('start',''),'end'=>_('end',''),'min'=>_('min'),'max'=>_('max')),true);
		$this->ret = self::success(array('ret'=>$ret, 'pages'=>$pages,'total'=>$total));
		$this->view = 'list';
	}
}